package com.atbeijing.bigdata.spark.mytest.core

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object WordCount2 {
  def main(args: Array[String]): Unit = {
    //local[4]表示有4个核来计算
    val sparkConf: SparkConf = new SparkConf().setMaster("local[4]").setAppName("word1")
    val context = new SparkContext(sparkConf)

    val seq: Seq[Int] = Seq(1,2,3,4,5,6)
    val w: RDD[Int] = context.makeRDD(seq,2)
    w.collect().foreach(println)
    //w.saveAsTextFile("output")
  }
}
